import * as actionTypes from './actionTypes';

const initState = {
  userName: window.localStorage.getItem('username') ? window.localStorage.getItem('username') : ''
}

export default (state = initState,action) => {
  switch (action.type) {
    case actionTypes.SET_USERNAME:
      return Object.assign({},state,{userName:action.userName})
  
    default:
      return state;
  }
}
